﻿@using Entities;
@using System.Reflection;
@model IEnumerable<DirectoryCount>
@{  var gridColumns = new List<WebGridColumn>();

    foreach (PropertyInfo property in typeof(DirectoryCount).GetProperties())
    {
        gridColumns.Add(new WebGridColumn { ColumnName = property.Name, CanSort = true });
    }

    var grid = new WebGrid(source: Model, canSort: true, rowsPerPage: int.Parse(WebUI.Resources.PageSize), ajaxUpdateContainerId: "MostAccessedDirectoriesGrid");    
    @grid.GetHtml(htmlAttributes: new { id = "grid" }, tableStyle: "main_table", headerStyle: "columns_head",
 columns: gridColumns)
}
